import java.util.HashMap;

public class StreamDemo2 {
    public static void main(String[] args){
        //以HashMap为例子
        //1.创建双列集合
        HashMap<String,Integer> hm=new HashMap<>();
        //2.添加数据
        hm.put("aaa",111);
        hm.put("bbb",222);
        hm.put("ddd",4567);
        hm.put("ccc",789);
    //1.第一种获取Stream流
        hm.keySet().stream().forEach(s-> System.out.println(s));
        //2.第二种获取stream流
        hm.entrySet().stream().forEach(s-> System.out.println(s));
    }
}
